<!doctype html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>日常护理</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link href="/senior_assets/css/bootstrap.min.css" rel="stylesheet">
	<link href="/senior_assets/css/style.css" rel="stylesheet">
	<link href="/senior_assets/css/font-awesome.css" rel="stylesheet">
</head>
<body>
	<div class="container-fluid">
		<div class="om-ctl-mes">
			<div class="title">
				<div class="col-xs-12"><span class="fa fa-list-ul"> 老人管理</span><b class="fa fa-caret-right"></b><i>日常护理</i></div>
			</div>
			<div class="seltemple">
				<div class="col-xs-12">
					<form class="form-inline"  method="get" action="/admin_nurse">
					<?if($_COOKIE['admin']['roles'] == 1 || $_COOKIE['admin']['roles'] == 2){?>
					<div class="col-xs-3 mes-group"><label>部门</label><select name="department" value='<?=$pDepartment?>'><option value="0">请选择</option><?foreach($tDIData as $tDIRow){?><option value="<?=$tDIRow['num']?>" <?if($tDIRow['num'] == $pDepartment){echo 'selected';}?>><?=$tDIRow['introduce']?></option><?}?></select></div>
					<?}?>
                    <div class="col-xs-3">
                    
                    <label for="exampleInputName2">入院时间</label>
                    <div class="input-group date form_date" data-date="" data-date-format="yyyy-mm-dd" data-link-field="updated">
                    <input class="form-control" id="form-control" size="16"  readonly="" placeholder="选择入院日期" type="text" name="created"  id="jcnow" value="<?=$pCreated?>" onclick="WdatePicker();">
                    </div>
                    <input id="updated" value="" name="updated" type="hidden"><br>
                    	
                    </div>			
					<div class="col-xs-3 mes-search"><label>关键词搜索</label><input type="text" placeholder="老人姓名/委托人电话" name="name" value="<?=$pName?>"><button id="search" type='button'>搜索</button></div>
					</form>	
				</div>
			</div>
			<div  class="mes-conttent col-xs-12">
				<table class="table">
	              <thead>
	             	<tr>
			        <th>编号</th>
			        <th>老人姓名</th>
			        <th>所在部门</th>
			        <th>入院时间</th>
			        <th>血糖</th>
			        <th>体温</th>
			        <th>血压</th>
			        <th>精神状态</th>
			        <th>记录时间</th>
			        <th>操作</th>
		            </tr>
	              </thead>
	             <tbody>
					<?foreach($tSDatas as $tRow){?>
		          	 <tr>
		           	 <td><?=$tRow['id']?></td>
			         <td><span><?=$tRow['name']?></span><small class="hiddendiv"></small></td>
			         <td><?=$tRow['department']?></td>
			         <td><?=date('Y-m-d H:i',$tRow['created'])?></td>
			         <td><?=$tRow['blood_sugar']?>mmol/l</td>
			         <td><?=$tRow['temperature']?>℃</td>
			         <td><?=$tRow['high_pressure']?>/<?=$tRow['low_pressure']?>mmHG</td>
			         <td><?if($tRow['mood_status'] == 1){echo '开心';}else if($tRow['mood_status'] == 2){echo '正常';}else if($tRow['mood_status'] == 3){echo '焦虑';}else if($tRow['mood_status'] == 4){echo '孤独';}else if($tRow['mood_status'] == 5){echo '自卑';}else if($tRow['mood_status'] == 6){echo '多疑';}else if($tRow['mood_status'] == 7){echo '忧郁';}else if($tRow['mood_status'] == 8){echo '恐惧';}?><br>
                        <span>皮肤状态：</span><?if($tRow['skin_status'] == 1){echo '完好';}else if($tRow['skin_status'] == 2){echo '轻度';}else if($tRow['skin_status'] == 3){echo '中度';}else if($tRow['skin_status'] == 4){echo '重度';}?></td>
			         <td>2017-04-07 18:00</td>
			         <td>
			         	<a href="/admin_nurse/detail?sid=<?=$tRow['id']?>"><button style="color:black;">查看</button></a>
			         </td>
		           </tr>
		           <?}?>
	            </tbody>
              </table>
              <?=$tShow?>
			</div>
		</div>
    </div>
</body>
<script type="text/javascript" src=/senior_assets/js/jquery.min.js></script>
<script type="text/javascript" src="/plugins/datepicker/WdatePicker.js" charset="UTF-8">
<script type="text/javascript">
$(function(){
     //获取浏览器宽度
     var tds =$("td:nth-child(6)").html(),
         num = tds.substring(0, 4);
     if(num>30){
            //直接为该div添加w1024样式,会覆盖前一个样式
           $(this).css("color","red");
     }
     console.log(num)
});
</script>
    <script type="text/javascript" src="/senior_assets/js/jquery.min.js"></script>
    <script type="text/javascript" src="/senior_assets/js/jq.js"></script>
    <script>
    $('#search').click(function(){
		$('form').submit();
	});
    </script>
</html>